Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent execution with incompatible yamllint configuration #4139

Merged
merged 1 commit into from
May 7, 2024

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented May 7, 2024

  • prevent running ansible-lint if incompatible yamllint custom settings are found
  • report incompatible yamllint settings
  • update documentation to explain which options are divergent and why

This change has the potential of breaking linting for users that do have a custom .yamllint config file. Still, the error given should make the fix very easy as it will mention each option that needs to be changed and to which value, like below:

CRITICAL Found incompatible custom yamllint configuration (.yamllint), please either remove the file or edit it to comply with:

  • comments.min-spaces-from-content must be 1
  • braces.min-spaces-inside must be 0
  • braces.max-spaces-inside must be 1
  • octal-values.forbid-implicit-octal must be true
  • octal-values.forbid-explicit-octal must be true

Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements.

This change ensures that when running --fix we do not end-up with a regression regarding number of yamllint rule violations. As mentioned inside the documentation, there are technical and compatibility reasons why we cannot make these few options configurable.

Fixes: #3890
Fixes: #4118

@ssbarnea ssbarnea added the major Used for release notes, requires major versioning bump label May 7, 2024
@github-actions github-actions bot added the bug label May 7, 2024
@ssbarnea ssbarnea removed the bug label May 7, 2024
hswong3i added a commit to alvistack/docker-centos that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-bamboo that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-dnsmasq that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-fisheye that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-gitlab-ee that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-devel that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-fedora that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-gitlab-ce that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-opensuse that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-httpd that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-mitmproxy that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-mariadb that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-almalinux that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-postfix that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-jira that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-rhel that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-php-fpm that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-postgres that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-debian that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-devel that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/docker-ubuntu that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-centos that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-ceph that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-kubernetes that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-fedora that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-rhel that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-opensuse that referenced this pull request May 19, 2024
hswong3i added a commit to alvistack/vagrant-ubuntu that referenced this pull request May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Used for release notes, requires major versioning bump
Projects
Archived in project
2 participants